package com.qyer.search.report;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * User: Z J Wu Date: 2016/01/07 Time: 20:26 Package: com.qyer.search.report
 */
public class TimeCost {

  private long wordETLTime;

  private long planTime;

  private long searchTime;

  private long transformResultTime;

  private long sortResultTime;

  private long requestTime;

  private Map<String, Long> otherTimeMap = Maps.newHashMapWithExpectedSize(3);

  public TimeCost(long wordETLTime, long planTime, long searchTime, long transformResultTime,
                  long sortResultTime, long requestTime) {
    this.wordETLTime = wordETLTime;
    this.planTime = planTime;
    this.searchTime = searchTime;
    this.transformResultTime = transformResultTime;
    this.sortResultTime = sortResultTime;
    this.requestTime = requestTime;
  }

  public TimeCost addTime(String name, long otherTime) {
    this.otherTimeMap.put(name, otherTime);
    return this;
  }

  public long getWordETLTime() {
    return wordETLTime;
  }

  public void setWordETLTime(long wordETLTime) {
    this.wordETLTime = wordETLTime;
  }

  public long getPlanTime() {
    return planTime;
  }

  public void setPlanTime(long planTime) {
    this.planTime = planTime;
  }

  public long getSearchTime() {
    return searchTime;
  }

  public void setSearchTime(long searchTime) {
    this.searchTime = searchTime;
  }

  public long getTransformResultTime() {
    return transformResultTime;
  }

  public void setTransformResultTime(long transformResultTime) {
    this.transformResultTime = transformResultTime;
  }

  public long getRequestTime() {
    return requestTime;
  }

  public void setRequestTime(long requestTime) {
    this.requestTime = requestTime;
  }

  public Map<String, Long> getOtherTimeMap() {
    return otherTimeMap;
  }

  public void setOtherTimeMap(Map<String, Long> otherTimeMap) {
    this.otherTimeMap = otherTimeMap;
  }

  public long getSortResultTime() {
    return sortResultTime;
  }

  public void setSortResultTime(long sortResultTime) {
    this.sortResultTime = sortResultTime;
  }
}
